//
//  TcAlert.m
//  TradeCircle
//
//  Created by SHERMAN on 2017/7/12.
//  Copyright © 2017年 sherman. All rights reserved.
//

#import "TcAlert.h"
#import "LPPopup.h"

@implementation TcAlert

+ (void)showLppWithText:(NSString *)text inView:(UIView *)showView
{
    [TcAlert showLppWithText:text inView:showView completion:nil];
}

+ (void)showLppWithText:(NSString *)text inView:(UIView *)showView completion:(void(^)(void))block
{
    if (!showView) {
        showView = [UIApplication sharedApplication].keyWindow;
    }
    
    for (UIView *subView in showView.subviews) {
        if ([subView isKindOfClass:[LPPopup class]]) {
            [subView removeFromSuperview];
        }
    }
    LPPopup *lpp = [LPPopup popupWithText:text];
    lpp.popupColor = COLOR(.0f, .0f, .0f, 6.0f);
    lpp.textColor = [UIColor whiteColor];
    [lpp showInView:showView centerAtPoint:showView.center duration:1.0f completion:block];
}



@end
